<?php

class TW_Request {
    private $_controller = 'index';
    private $_method = 'main';
    private $_args = array();

    public function __construct() {
        if( !isset($_GET['url']) ) return false;

        $segment = explode('/', $_GET['url']);

        $this->_controller = ($c = array_shift($segment)) ? $c : 'index';
        $this->_method = ($m = array_shift($segment)) ? $m : 'main';
        $this->_args = (isset($segment[0])) ? $segment : array();

    }

    public function getController() {
        return $this->_controller;
    }

    public function getMethod() {
        return $this->_method;
    }

    public function getArgs() {
        return $this->_args;
    }

}